#include<iostream>
using namespace std;
int main()
{
	int a, b;
	while (cin >> a >> b) {
		if (a == 0 || b == 0) {
			cout << 1 << endl;
			continue;
		}
		if (a == b) {
			continue;
		}
		a--;
		b--;
		int c = a + b;
		if (c % 2 == 0) {
			cout << 1 << endl;
		}
		else {
			cout << 0 << endl;
		}
	}
	return 0;
}